package indi.zhifa.recipe.bailan5.auth.controller.init;
import indi.zhifa.recipe.bailan.framework.auth.service.IAuthInitService;
import indi.zhifa.recipe.bailan.framework.common.util.DtoEntityUtil;
import indi.zhifa.recipe.bailan.framework.enums.appproperties.EnumMemoConfig;
import indi.zhifa.recipe.bailan.framework.enums.service.IEnumMemoService;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@RequiredArgsConstructor
@Component
public class Init implements CommandLineRunner {
    private final IEnumMemoService mEnumMemoService;
    private final EnumMemoConfig mEnumMemoConfig;
    private final IAuthInitService mAuthInitService;

    @Override
    public void run(String... args) throws Exception {
        DtoEntityUtil.init();
        mEnumMemoService.initEnum(mEnumMemoConfig.getEnumPackages());
        mAuthInitService.init();
    }
}
